/**
 *Copyright (c) 2024 watereyes
 * safetymanagement is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */
package com.koron.emergency.util;

public enum BusinessCode {
    SUCCESS(0,"success"),
    FAILURE(-1,"fail"),
    EXCEPTION(-2,"执行过程中发生异常"),
    NOT_LONGIN(10000,"获取用户失败,请重新登录"),
    EMPTY_PARAM(-4,"必填参数不能为空"),
    NOT_CHANGE_DATA(1100000,"未选中数据"),
    EMERGENCYINSTITUTIONS_EMPTY_NAME(1100001,"机构名称不能为空"),
    EMERGENCYINSTITUTIONS_EMPTY_CORPCODE(1100002,"机构所属水司不能为空"),
    EMERGENCYINSTITUTIONS_NOT_CHANGE_DATA(1100003,"未选中数据"),
    EMERGENCYINSTITUTIONS_NOT_EXIST(1100004,"机构不存在"),
    EMERGENCYINSTITUTIONS_PARENT_NOT_EXIST(1100005,"父节点不存在"),
    EMERGENCYINSTITUTIONS_PARENT_IS_EXIST(1100006,"该水司下存在应急机构，所以所属父部门不能为空"),
    EMERGENCYINSTITUTIONS_IS_EXIST_CHILD(1100007,"部门下存在子部门，无法删除"),
    EMERGENCYINSTITUTIONS_IS_EXIST_STAFF(1100008,"部门下关联了人员，无法删除"),
    STAFF_EMPTY_EMERGENCYINSTITUTIONS(1100009,"人员所在应急机构不能为空"),
    STAFF_EMPTY_DEPARTMENT(1100010,"人员所在部门不能为空"),
    STAFF_EMPTY_STAFF(1100011,"数据不存在，无法进行修改或删除操作"),
    STAFF_EMPTY_DUTY(1100012,"职责描述不能为空"),
    STAFF_EMPTY_ROLE(1100013,"机构角色不能为空"),
    STAFF_NOT_EXIST(1100014,"机构人员不存在"),
    DRILLPLAN_EMPTY_NAME(1100015,"演练计划名称不能为空"),
    DRILLPLAN_EMPTY_PURPOSE(1100016,"演练目的不能为空"),
    DRILLPLAN_EMPTY_MANAGER(1100017,"演练负责人不能为空"),
    DRILLPLAN_EMPTY_PLACE(1100018,"演练地点不能为空"),
    DRILLPLAN_EMPTY_METHOD(1100019,"演练方式不能为空或不存在的演练方式"),
    DRILLPLAN_EMPTY_TIME(1100020,"演练计划时间不能为空"),
    DRILLPLAN_EMPTY_SPONSORDEPTCODE(1100021,"主办部门不能为空"),
    DRILLPLAN_EMPTY_CONTINGENCYPLANID(1100022,"应急预案不能为空"),
    DRILLPLAN_EMPTY_CORPCODE(1100023,"演练计划所属水司不能为空"),
    DRILLPLAN_DOUBLE_NAME(1100024,"同一水司下的演练计划名称不能重复"),
    DRILLPLAN_NOT_EXIST(1100025,"演练计划不存在"),
    DRILLASSESSMENT_EMPTY_NAME(1100026,"演练评估名称不能为空"),
    DRILLASSESSMENT_EMPTY_PURPOSE(1100027,"演练目的不能为空"),
    DRILLASSESSMENT_EMPTY_MANAGER(1100028,"演练负责人不能为空"),
    DRILLASSESSMENT_EMPTY_PLACE(1100029,"演练地点不能为空"),
    DRILLASSESSMENT_EMPTY_METHOD(1100030,"演练方式不能为空或不存在的演练方式"),
    DRILLASSESSMENT_EMPTY_TIME(1100031,"演练时间不能为空"),
    DRILLASSESSMENT_EMPTY_SPONSORDEPTCODE(1100032,"主办部门不能为空"),
    DRILLASSESSMENT_EMPTY_CONTINGENCYPLANID(1100033,"应急预案不能为空"),
    DRILLASSESSMENT_EMPTY_CORPCODE(1100034,"演练评估所属水司不能为空"),
    DRILLASSESSMENT_DOUBLE_NAME(1100035,"同一水司下的演练计划名称不能重复"),
    DRILLASSESSMENT_NOT_EXIST(1100036,"演练评估不存在"),
    EMERGENCYRESPONSE_EMPTY_CORP(1100037,"应急响应所属水司不能为空"),
    EMERGENCYRESPONSE_EMPTY_CONTENT(1100038,"应急响应内容不能为空"),
    EMERGENCYRESPONSE_EMPTY_RESPONSELEVEL(1100039,"应急响应等级不能为空,或者应急响应等级值不合法"),
    EMERGENCYRESPONSE_NOT_EXIST(1100040,"应急响应记录不存在"),
    EMERGENCYMATERIAL_EMPTY_NAME(1100041,"应急物资名称不能为空"),
    EMERGENCYMATERIAL_EMPTY_MATERIALTYPE(1100042,"应急物资类型不能为空"),
    EMERGENCYMATERIAL_EMPTY_MANAGER(1100043,"应急物资责任人不能为空"),
    EMERGENCYMATERIAL_EMPTY_CHECKMANAGER(1100044,"应急物资检查责任人不能为空"),
    EMERGENCYMATERIAL_NOT_EXIST(1100045,"应急物资不存在"),
    EMERGENCYMATERIAL_EMPTY_CORP(1100046,"应急物资所属水司不能为空"),
    CHECKRECORD_EMPTY_CORPCODE(1100047,"检查记录所属水司不能为空"),
    CHECKRECORD_EMPTY_TITLE(1100048,"检查记录标题不能为空"),
    CHECKRECORD_EMPTY_CHECKEMPLOYEECODE(1100049,"检查记录负责人不能为空"),
    CHECKRECORD_EMPTY_EXCUTORCODES(1100050,"检查记录执行人不能为空"),
    CHECKRECORD_EMPTY_CHECKTIME(1100051,"检查日期不能为空"),
    CHECKRECORD_NOT_EXIST(1100052,"检查记录不存在"),
    CHECKRECORD_DOUBLE_TITLE(1100053,"检查记录标题重复"),
    CHECKRECORD_IS_COMFIRMED(1100054,"检查记录已经提交，无法操作"),
    HIDDENDANGER_CANNOT_EDIT(1100055,"隐患已经提交，无法操作"),
    TYPE_EMPTY_CONTINGENCYPLAN(1100056,"应急预案类型不能为空"),
    LEVEL_EMPTY_RESPONSE(1100057,"响应等级不能为空"),
    COMPANY_EMPTY_SUBORDINATE(1100058,"应急预案所属单位不能为空"),
    CONTINGENCYPLAN_NOT_EXIST(1100059,"应急预案不存在"),
    CONTINGENCYPLAN_EMPTY_CORP(1100060,"应急预案所属水司不能为空"),
    EMERGENCYMATERIAL_DOUBLE_CODE(1100061,"应急物资编码重复"),
    NAME_EMPTY_CONTINGENCYPLAN(1100062,"应急预案名称不能为空"),
    CONTINGENCYPLAN_EMPTY_VERSION(1100063,"应急预案版本号不能为空"),
    CONTINGENCYPLAN_EMPTY_PUBLICATIONDATE(1100064,"应急预案发布日期不能为空"),
    CONTINGENCYPLAN_EMPTY_EXECUTIONDATE(1100065,"应急预案实施日期不能为空"),
    CONTINGENCYPLAN_EMPTY_APPLICABLEPROVISIONS(1100066,"应急预案适用条款不能为空"),
    DRILL_PLAN_EMPTY_APPROVER(1100067,"演练计划审批人不能为空"),
    DRILL_PLAN_IS_APPROVEING(1100068,"演练计划正在审批中，无法修改"),
    EMERGENCY_RESPONSE_EMPTY_APPROVER(1100069,"应急事件审批人不能为空"),
    EMERGENCY_RESPONSE_IS_APPROVEING(1100070,"应急事件正在审批中，无法操作"),
    EMERGENCYINSTITUTIONS_DOUBLE_NAME(1100071,"应急机构同级名称不能重复"),
    EMERGENCYDEVICE_EMPTY_NAME(1100072,"应急设备名称不能为空"),
    EMERGENCYDEVICE_EMPTY_DEVICETYPE(1100073,"应急设备类型不能为空"),
    EMERGENCYDEVICE_EMPTY_MANAGER(1100074,"应急设备责任人不能为空"),
    EMERGENCYDEVICE_EMPTY_CHECKMANAGER(1100075,"应急设备检查责任人不能为空"),
    EMERGENCYDEVICE_NOT_EXIST(1100076,"应急设备不存在"),
    EMERGENCYDEVICE_EMPTY_CORP(1100077,"应急设备所属水司不能为空"),
    EMERGENCYDEVICE_DOUBLE_CODE(1100078,"应急设备编码重复"),
    DRILLPLANTYPE_NOT_EXIST(1100079,"演练类型不能为空"),
    ;
    private final int code;
    private final String description;

    public int getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    BusinessCode(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public static BusinessCode valueOf(int value){
        return switch (value) {
            case 0 -> SUCCESS;
            case -1 -> FAILURE;
            case -2 -> EXCEPTION;
            case 10000 -> NOT_LONGIN;
            case 1100000 -> NOT_CHANGE_DATA;
            case 1100001 -> EMERGENCYINSTITUTIONS_EMPTY_NAME;
            case 1100002 -> EMERGENCYINSTITUTIONS_EMPTY_CORPCODE;
            case 1100003 -> EMERGENCYINSTITUTIONS_NOT_CHANGE_DATA;
            case 1100004 -> EMERGENCYINSTITUTIONS_NOT_EXIST;
            case 1100005 -> EMERGENCYINSTITUTIONS_PARENT_NOT_EXIST;
            case 1100006 -> EMERGENCYINSTITUTIONS_PARENT_IS_EXIST;
            case 1100007 -> EMERGENCYINSTITUTIONS_IS_EXIST_CHILD;
            case 1100008 -> EMERGENCYINSTITUTIONS_IS_EXIST_STAFF;
            case 1100009 -> STAFF_EMPTY_EMERGENCYINSTITUTIONS;
            case 1100010 -> STAFF_EMPTY_DEPARTMENT;
            case 1100011 -> STAFF_EMPTY_STAFF;
            case 1100012 -> STAFF_EMPTY_DUTY;
            case 1100013 -> STAFF_EMPTY_ROLE;
            case 1100014 -> STAFF_NOT_EXIST;
            case 1100015 -> DRILLPLAN_EMPTY_NAME;
            case 1100016 -> DRILLPLAN_EMPTY_PURPOSE;
            case 1100017 -> DRILLPLAN_EMPTY_MANAGER;
            case 1100018 -> DRILLPLAN_EMPTY_PLACE;
            case 1100019 -> DRILLPLAN_EMPTY_METHOD;
            case 1100020 -> DRILLPLAN_EMPTY_TIME;
            case 1100021 -> DRILLPLAN_EMPTY_SPONSORDEPTCODE;
            case 1100022 -> DRILLPLAN_EMPTY_CONTINGENCYPLANID;
            case 1100023 -> DRILLPLAN_EMPTY_CORPCODE;
            case 1100024 -> DRILLPLAN_DOUBLE_NAME;
            case 1100025 -> DRILLPLAN_NOT_EXIST;
            case 1100026 -> DRILLASSESSMENT_EMPTY_NAME;
            case 1100027 -> DRILLASSESSMENT_EMPTY_PURPOSE;
            case 1100028 -> DRILLASSESSMENT_EMPTY_MANAGER;
            case 1100029 -> DRILLASSESSMENT_EMPTY_PLACE;
            case 1100030 -> DRILLASSESSMENT_EMPTY_METHOD;
            case 1100031 -> DRILLASSESSMENT_EMPTY_TIME;
            case 1100032 -> DRILLASSESSMENT_EMPTY_SPONSORDEPTCODE;
            case 1100033 -> DRILLASSESSMENT_EMPTY_CONTINGENCYPLANID;
            case 1100034 -> DRILLASSESSMENT_EMPTY_CORPCODE;
            case 1100035 -> DRILLASSESSMENT_DOUBLE_NAME;
            case 1100036 -> DRILLASSESSMENT_NOT_EXIST;
            case 1100037 -> EMERGENCYRESPONSE_EMPTY_CORP;
            case 1100038 -> EMERGENCYRESPONSE_EMPTY_CONTENT;
            case 1100039 -> EMERGENCYRESPONSE_EMPTY_RESPONSELEVEL;
            case 1100040 -> EMERGENCYRESPONSE_NOT_EXIST;
            case 1100041 -> EMERGENCYMATERIAL_EMPTY_NAME;
            case 1100042 -> EMERGENCYMATERIAL_EMPTY_MATERIALTYPE;
            case 1100043 -> EMERGENCYMATERIAL_EMPTY_MANAGER;
            case 1100044 -> EMERGENCYMATERIAL_EMPTY_CHECKMANAGER;
            case 1100045 -> EMERGENCYMATERIAL_NOT_EXIST;
            case 1100046 -> EMERGENCYMATERIAL_EMPTY_CORP;
            case 1100047 -> CHECKRECORD_EMPTY_CORPCODE;
            case 1100048 -> CHECKRECORD_EMPTY_TITLE;
            case 1100049 -> CHECKRECORD_EMPTY_CHECKEMPLOYEECODE;
            case 1100050 -> CHECKRECORD_EMPTY_EXCUTORCODES;
            case 1100051 -> CHECKRECORD_EMPTY_CHECKTIME;
            case 1100052 -> CHECKRECORD_NOT_EXIST;
            case 1100053 -> CHECKRECORD_DOUBLE_TITLE;
            case 1100054 -> CHECKRECORD_IS_COMFIRMED;
            case 1100055 -> HIDDENDANGER_CANNOT_EDIT;
            case 1100071 -> EMERGENCYINSTITUTIONS_DOUBLE_NAME;
            default -> null;
        };
    }
}
